<template>
    <div class="tab-contorl">
        <van-tabs v-model="active" color="#1989fa" @click="onClick">
            <van-tab v-for="item in titles" :title="item"></van-tab>
        </van-tabs>
    </div>
</template>

<script>
  import Vue from 'vue';
  import { Tab, Tabs } from 'vant';

  Vue.use(Tab).use(Tabs);
  export default {
    name: "tabContorl",
    props:{
      titles:Array
    },
    data(){
      return{
        active:0
      }
    },
    methods:{
      onClick(index,title){
        this.$emit('tabClick',index)
      }
    }
  }
</script>

<style scoped>

</style>
